package szwolaiyun.paireach.com.szwolaizhuang.fragment;

import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import szwolaiyun.paireach.com.szwolaizhuang.R;
import szwolaiyun.paireach.com.szwolaizhuang.util.MessageInfoUtil;

/**
 * 装/卸货中 的Fragment
 * Created by Administrator on 2016/7/20.
 */
public class WorkingFragment extends Fragment implements View.OnClickListener {
    private View view;
    private Handler handler;
    private Button finish_work;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.fragment_working,null);
        initControl();
        return view;
    }
    public void setHandle(Handler handler){
        this.handler=handler;
    }

    private void initControl(){
        finish_work=(Button)view.findViewById(R.id.finish_work);
        finish_work.setOnClickListener(this);
    }

    public void goBack(){
        handler.sendEmptyMessage(MessageInfoUtil.TO_HOME);
    }

    @Override
    public void onClick(View v) {
        switch(v.getId()){
            case R.id.finish_work:
                handler.sendEmptyMessage(MessageInfoUtil.TO_SCAN);
                break;
        }
    }
}
